<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    /**
     * Constructor de la clase makinita.
     * @param array $entrada
     * @param array $reglas
     * @return boolean $error
     */

     
class sfTdText extends sfTdBase {
    

    /**
     * Constructor.
     *
     * Available options:
     *
     *  * id_format:       The format for the generated HTML id attributes (%s by default)
     *  * is_hidden:       true if the form widget must be hidden, false otherwise (false by default)
     *  * default:         The default value to use when rendering the widget
     *  * title:           The title to use when the widget is rendered
     *  * link:            The link of the widget
     *  * text:            The text inside of td
     * 
     * @param array $options     An array of options
     * @param array $attributes  An array of default HTML attributes
     *
     * @see sfWidget
     */
    public function __construct($options = array(), $attributes = array())
    {
      $this->addOption('text', null);     
      parent::__construct($options, $attributes);
    }    

    
    /**
     * Sets the text for the widget.
     *
     * @param string $value The text
     *    *
     * @return sfWidget The current widget instance
     */

      public function setText($text) {
          $this->setOption('text', $text);     
          return $this;
      }


    /**
     * Returns the text for the widget.
     *
     * @return string The text
     */

    public function getText() {
      return $this->getOption('text');
    }

    public function isModelTd() {
        return false;
    }
    
    
    public function render($content = '') {
        if(!$this->isHidden())
            return parent::render($this->getText());
        else 
            return '';
    }
    
}


?>
